<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2020/10/30
  Time: 19:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table align="center">
    <form action="${pageContext.request.contextPath}/Product/Product_update" method="post">
        <tr>
            <br >
                添加销售</br>
                商品名称:<select name="sale.productId">
            <c:forEach items="${products}" var="c"> <option value="${c.id}">${c.productName}</option></c:forEach>
        </select></br>
                销售单价:<input type="text" name="sale.price"></br>
                销售数量:<input type="text" id="saleNum" name="sale.quantity"></br>
                <input type="submit" value="保存">
            </td>
        </tr>
    </form>
</table>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.1.js"></script>
<script type="text/javascript">
    function x() {
        var c= $("#saleNum").val()
        if (isNaN(c)){
           alert("销售数量必须是数字")
        }
    }
</script>
</body>
</html>
